package competition;

import java.util.Scanner;

/**
 * @author ZhanBo
 * @date 2020/7/25
 */
public class MainB {

    public static void method(String s1 ,String s2){

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String  s1 = scanner.next();
            String  s2 = scanner.next();
            if (s1.equals(s2)||s1.length()!=s2.length()){
                System.out.println(-1);
            }else {

            }
        }
    }


}
